package abstractfactory.demo;

import abstractfactory.factory.FactoryProducer;
import abstractfactory.factory.Factory;
import abstractfactory.item.color.Color;
import abstractfactory.item.suit.Suit;

public class Demo {
    public static void main(String[] args) {
        Factory suitFactory = FactoryProducer.getFactory("suit");
        Factory colorFactory = FactoryProducer.getFactory("color");

        Suit suit1 = suitFactory.getSuit("clothes");
        suit1.dress();
        Color color1 = colorFactory.getColor("red");
        color1.draw();

        Suit suit2 = suitFactory.getSuit("trousers");
        suit2.dress();
        Color color2 = colorFactory.getColor("green");
        color2.draw();


        Suit suit3 = suitFactory.getSuit("shoes");
        suit3.dress();
        Color color3 = colorFactory.getColor("blue");
        color3.draw();


    }
}
